package com.zmn.plat.common.dictionary;

/**
 * 合同文件类型枚举
 *
 * @author linfeng
 * @since 2020/05/13 14:56:30
 */
public enum ContractFileTypeEnum {

    /**
     * values
     */
    SONCONTRACT(1, "附件协议/子合同"),
    CONTRACTSCANCOPY(2, "合同扫描件")
    ;

    private Integer code;
    private String name;

    ContractFileTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ContractFileTypeEnum of(Integer code) {
        if (code == null || code == 0) {
            return SONCONTRACT;
        }
        switch (code) {
            case 1:
                return SONCONTRACT;
            case 2:
                return CONTRACTSCANCOPY;
            default:
                return SONCONTRACT;
        }
    }
}
